﻿
'Description:批次管理业务类接口
'Copyright (c) : 通力凯顿（北京）系统集成有限公司
'Writer:Yangsj
'create Date:2017-4-14
'Rewriter:
'Rewrite Date:
Imports BusinessRule.DTO
Imports Camstar.WebClient.WebServicesProxy.InSiteWebServices

Public Interface uLMSContainerIBusiness
    ''' <summary>
    ''' 获取批次历史数据
    ''' </summary>
    ''' <param name="strContainerID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerHistoryData(ByVal strContainerID As String) As DataTable
    ''' <summary>
    ''' 获取批次信息数据
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerInfoData(ByVal strContainerName As String) As DataTable

    ''' <summary>
    ''' 通过批次Name获取批次信息 add by tianFW 2018年12月18日
    ''' </summary>
    ''' <param name="strContainerName"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerInfoDataByName(ByVal strContainerName As String) As DataTable

    ''' <summary>
    ''' 查询单件单卡子卡的所需信息
    ''' add:Wangjh 20180827
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetChildContainerNo(ByVal para As Dictionary(Of String, String)) As DataTable
    ''' <summary>
    ''' 查询单件单卡子卡的所需信息
    ''' add:Wangjh 20180827
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetZSChildContainerNo(ByVal para As Dictionary(Of String, String)) As DataTable
    ''' <summary>
    ''' 获取批次表信息数据
    ''' create：YangSJ 2017-12-8
    ''' </summary>
    ''' <param name="strContainerName"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerData(ByVal strContainerName As String) As DataTable
    ''' <summary>
    ''' 根据订单ID获取批次列表
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerListByMfgOrder(ByVal strMfgOrderID As String) As uMESProcessResult
    ''' <summary>
    ''' 流水卡建卡
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function StartContainer(ByVal para As ContainerStartInfo) As ResultStatus
    ''' <summary>
    ''' 添加批次扩展信息
    ''' </summary>
    ''' <param name="serverHost"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function AddExtendAttribute(ByVal attributeDT As DataTable, ByVal serverHost As ServerHostInfo) As ResultStatus
    ''' <summary>
    ''' 批次移动
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerMoveStd(ByVal host As ServerHostInfo, ByVal strContainerName As String, ByVal strEmployee As String, ByRef strMsg As String) As Boolean

    ''' <summary>
    ''' 批次移动
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerMoveStd(ByVal host As ServerHostInfo, ByVal strContainerName As String, ByVal strEmployee As String, ByVal note As String, ByRef strMsg As String) As Boolean
    ''' <summary>
    ''' 批次非标移动
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerMoveNonStd(ByVal host As ServerHostInfo, ByVal strContainerName As String, ByVal strWorkFlow As String, ByVal strWFVersion As String, ByVal strToStep As String, ByVal strEmployee As String, ByVal ToStepID As String, ByRef strMsg As String, Optional ByVal notes As String = "") As Boolean
    ''' <summary>
    ''' 报废批次数量
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks> 
    Function ScrapContainerQty(ByVal host As ServerHostInfo, ByVal strContainerName As String, ByVal dtChildList As DataTable, ByRef strMsg As String) As Boolean

    ''' <summary>
    ''' 批次拆分
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function SplitContainer(ByVal para As ContainerSplitInfo) As ResultStatus
    ''' <summary>
    ''' 获取批次当前信息（调度平台用)
    ''' create:Wangjh
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetCurrentContianerInfo(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    ''' <summary>
    ''' 获取批次当前信息（调度平台用)
    ''' create:Wangjh
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetZSCurrentContianerInfo(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    ''' <summary>
    '''批次关闭
    ''' create:Wangjh 2017-9-6
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerClosed(ByVal host As ServerHostInfo, ByVal strContainerName As String, ByVal strCloseReason As String, ByVal strNotes As String, ByRef strMsg As String) As Boolean

    ''' <summary>
    ''' 批次打开
    ''' create:Wangjh
    ''' </summary>
    ''' <param name="host"></param>
    ''' <param name="strContainerName"></param>
    ''' <param name="strOpenReason"></param>
    ''' <param name="strMsg"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerOpen(ByVal host As ServerHostInfo, ByVal strContainerName As String, ByVal strOpenReason As String, ByRef strMsg As String) As Boolean

    ''' <summary>
    ''' 批次数量修改
    ''' create:Wangjh 2017-9-7
    ''' </summary>
    ''' <param name="host"></param>
    ''' <param name="strContainerName"></param>
    ''' <param name="changeQry"></param>
    ''' <param name="strChangeReason"></param>
    ''' <param name="strMsg"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerChangeQty(ByVal host As ServerHostInfo, ByVal strContainerName As String, ByVal changeQry As Integer, ByVal strChangeReason As String, ByRef strMsg As String) As Boolean

    ''' <summary>
    ''' 根据containerID更改批次类型
    ''' </summary>
    ''' <param name="containerid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ChangeContainerType(ByVal containerid As String, ByVal type As Integer) As Boolean

    ''' <summary>
    ''' 删除流水卡
    ''' create:Wangjh 2017-9-7
    ''' </summary>
    ''' <param name="containers"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateDelContainer(ByVal containers As String) As Boolean
    ''' <summary>
    ''' 根据containerID更新工艺员
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateEngineerNameOfContainer(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 根据父containerID查询关闭的子批次 
    ''' create:Wangjh 2017-9-13
    ''' </summary>
    ''' <param name="containerID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetChildContainerInfo(ByVal containerID As String) As DataTable

    ''' <summary>
    ''' 查询move情况
    ''' create:Wangjh 2017-9-26
    ''' </summary>
    ''' <param name="containerID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerMoveInfo(ByVal containerID As String) As DataTable

    ''' <summary>
    ''' 插入子工艺校对信息
    ''' create：Wangjh 20171212
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function InsertSubWorkFlowCheckInfo(ByVal para As Dictionary(Of String, String)) As Boolean


    ''' <summary>
    ''' 删除子工艺校对信息 create tianFW 2018年1月25日
    ''' </summary>
    ''' <param name="ContainerID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function DelSubWorkFlowCheckInfo(ByVal ContainerID As String) As Boolean

    ''' <summary>
    ''' 获取非本分厂存在子工艺的批次
    ''' create:Wangjh 20171213
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerOfSubWorkflowWithoutSelf(ByVal para As Dictionary(Of String, String)) As DataTable


    ''' <summary>
    ''' 根据批次获取所有子工艺信息
    ''' create:Wangjh 20171213
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetSubWorkFlowInfoByContainer(ByVal para As Dictionary(Of String, String)) As DataSet

    ''' <summary>
    ''' 更新子工艺校对表
    ''' create:Wangjh 20171214
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateSubWorkFlowCheckInfo(ByVal para As Dictionary(Of String, String)) As Boolean
    ''' <summary>
    ''' 查询批次子工艺校对信息
    ''' add:Wangjh 20180314
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetSubWorkFlowInfo(ByVal para As Dictionary(Of String, String)) As DataTable
    ''' <summary>
    ''' 更新总表工艺确认信息
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateContainerWfConfir(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 获取工艺最近选择的工艺员信息
    ''' </summary>
    ''' <param name="workflowID"></param>
    ''' <param name="type">0 主工艺 1 子工艺</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetWorkflowLatestCheckCheckTechniqueInfo(ByVal workflowID As String, ByVal type As String) As DataTable

    ''' <summary>
    ''' 获取件号上一次开卡批次的类型和领料类型 create by tianFW 2018年6月8日
    ''' </summary>
    ''' <param name="productname"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetProductLastTimeContainerTypeAndIsSelfmfg(ByVal productname As String) As DataTable

    ''' <summary>
    ''' 增加批次删除记录 create by tianFW 2018年7月13日
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function AddDeleteContainerRecord(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 查询批次工艺的加工记录
    ''' add:Wangjh 20180720
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetStepProcessRecord(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 根据主工艺查询子工艺
    '''  add:Wangjh 20180725
    ''' </summary>
    ''' <param name="workflowID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetSubWorkflowByWorkflowid(ByVal workflowID As String) As DataTable

    ''' <summary>
    ''' 更新子工艺校对表的时间
    ''' add:Wangjh 20180725
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateSubCheckWorkflowDate(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 获取分批信息
    ''' add:Wangjh 20180821
    ''' </summary>
    ''' <param name="splitContainer"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetSplitInfoBySplitContainer(ByVal splitContainer As String) As DataTable

    ''' <summary>
    ''' 判断批次是否被暂停
    ''' add:Wangjh 20180821
    ''' </summary>
    ''' <param name="IDs"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsHoldContainer(ByVal IDs As String) As Boolean

    ''' <summary>
    ''' 获取撤销的单件单卡信息  create by tianFW 2018-8-14
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetRepealSingletonContainerInfo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 判断是否是初检装还是其他(试车集件等及其他分厂的东西)
    ''' Add by Yuxj20180620,和Yangsj讨论，固定查询 部装，传装，总装,空值不为初检装，1：初装，2：检装
    ''' </summary>
    ''' <param name="ContainerId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function CheckFirstSecondIssue(ByVal ContainerId As String) As String

    Function CheckFirstSecondIssueNew(ByVal ContainerId As String) As String

    ''' <summary>
    ''' 获取管理暂停批次信息 create by tianFW 2018年8月21日
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetOperStopContainerInfo(ByVal para As Dictionary(Of String, String)) As DTO.uMESProcessResult

    ''' <summary>
    ''' 获取管理暂停批次详细信息 create by tianFW 2018年8月21日
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetOperStopContainerDetailInfo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 更新批次暂停状态 add by tianFW 2018年8月22日
    ''' </summary>
    ''' <param name="containerids"></param>
    ''' <param name="type"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function OperContainerStop(ByVal containerids As String, ByVal type As Integer) As Boolean

    ''' <summary>
    ''' 获取批次暂停原因
    ''' </summary>
    ''' <param name="containerid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerStopReason(ByVal containerid As String) As DataTable

    ''' <summary>
    ''' 批次暂停
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerHold(ByVal host As ServerHostInfo, ByVal strContainerName As String, ByVal strReason As String, ByRef strMsg As String) As Boolean

    ''' <summary>
    ''' 批次释放
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerRelease(ByVal host As ServerHostInfo, ByVal strContainerName As String, ByVal strReason As String, ByRef strMsg As String) As Boolean

    ''' <summary>
    ''' 获取批次操作信息 create by tianFW 2018年8月28日
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetOperContaienrInfo(ByVal para As Dictionary(Of String, String)) As uMESProcessResult

    ''' <summary>
    ''' 修改批次数量 create by tianFW 2018年8月30日
    ''' </summary>
    ''' <param name="containerid">批次ID</param>
    ''' <param name="qty">修改数量</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ChangeContainerQty(ByVal containerid As String, ByVal qty As Integer) As Boolean

    ''' <summary>
    ''' 增加检验批次数量改变记录 create by tianFW 2018年8月30日
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function AddCheckQtyChangeRecord(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 获取成品检验批次报废报工记录对应的报废数 create by tianFW 2018年9月12日
    ''' </summary>
    ''' <param name="containercheckID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetCheckQtyChangeRecordOfWorkReportLossInfo(ByVal containercheckID As String) As DataTable

    ''' <summary>
    ''' 获取批量带子序号的报废记录 create by tianFW 2018年9月10日
    ''' </summary>
    ''' <param name="IDs">报工IDs或检验ID</param>
    ''' <param name="type">1 根据报工ID查询 2 根据检验ID查询</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerHaveChildsOfLossChilds(ByVal IDs As String, ByVal type As Integer) As DataTable

    ''' <summary>
    ''' 获取没有子工艺开卡的信息 create by tianFW 2018年9月14日
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetSubWFProductOfNoContainer(ByVal para As Dictionary(Of String, String)) As uMESProcessResult


    ''' <summary>
    ''' 获取父工艺开卡的批次
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetFaWFContainerInfo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 装试删除批次后需要更改一些东西
    ''' add:Wangjh 20181109
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function DeleteOrUpdateSomeAfterDeleteOrUpdateContainer(ByVal para As Dictionary(Of String, String)) As String

    Function FillCheckQtyChangeRecord(ByVal para As Dictionary(Of String, String)) As Object()

    Function JudgeContainerStepIsFinish(ByVal contaienrid As String, ByVal stepid As String) As uMESProcessResult

    Sub InheritConSpecPlan(ByVal containerId As String, ByVal oldWorkflowId As String, ByVal newWorkflowId As String)

    '批次调度后插入批次操作日志信息 add zhunan 2022.6.24
    Sub InsertOperContainerInfo(ByVal para As Dictionary(Of String, String))

    ''' <summary>
    ''' 添加批次入库前的工艺 add by zhangrj 20220705
    ''' </summary>
    ''' <param name="containerId"></param>
    ''' <param name="bsWorkflowId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateContainerBsWorkflow(ByVal containerId As String, ByVal bsWorkflowId As String) As Boolean

    ''' <summary>
    ''' 获取同工艺已校对批次信息 add zhunan 2022.7.27
    ''' </summary>
    ''' <param name="workflowname">工艺名称</param>
    ''' <param name="workflowRevision">工艺版本</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetSameWorkflowVerifiedContainer(ByVal workflowname As String, ByVal workflowRevision As String) As DataTable

    Function ContainerStepIsAfterPXZY(ByVal containerID As String, ByVal workflowid As String, ByVal sequence As Integer) As uMESProcessResult
    ''' <summary>
    ''' 更新平行作业工序暂停批次
    ''' </summary>
    ''' <param name="param"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateParallelStepContainerHold(ByVal param As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 特殊过程工序暂停
    ''' </summary>
    ''' <param name="param"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateSpecialStepContainerHold(ByVal param As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 判断批次的检测项是否全部完成录入
    ''' add:Wangjh 20220902
    ''' </summary>
    ''' <param name="conDt"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function JudgeContainerCheckPoint(ByVal conDt As DataTable, Optional ByVal type As String = "") As uMESProcessResult
    Function ValidateContainerMoveBack(ByVal containerId As String) As uMESProcessResult
    ''' <summary>
    ''' 判断批次的检测项是否全部完成录入（检验）
    ''' add:zhangrj 20221018
    ''' </summary>
    ''' <param name="conDt"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function JudgeContainerCheckPointByCheck(ByVal conDt As DataTable) As uMESProcessResult

    ''' <summary>
    ''' yuxj20221201总体调度 增加处理enginepartplan 派工数，工序个数信息
    ''' </summary>
    ''' <param name="containerid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateEngineDispatchCount(ByVal containerid As String) As Boolean
    ''' <summary>
    ''' 验证工步实测值录入是否有效（热表） add by zhangrj 20230619
    ''' </summary>
    ''' <param name="dr"></param>
    ''' <param name="checkType">0：报工验证，1：检验验证</param>
    ''' <param name="msg"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsValidRBCheckPointByStepinfo(ByVal dr As DataRow, ByVal checkType As Integer, ByRef msg As String) As Boolean
    ''' <summary>
    ''' 通过批次ID查询其合批下的所有批次 add by zhangrj 20230619
    ''' </summary>
    ''' <param name="containerID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetCombinateContainerDetail(ByVal containerID As String) As DataTable
    ''' <summary>
    ''' 通过合批名查询合批下的所有批次 add by zhangrj 20230619
    ''' </summary>
    ''' <param name="combinateName"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetCombinateContainerDetailByName(ByVal combinateName As String) As DataTable
    ''' <summary>
    ''' 判断是否是合卡批次 add by zhangrj 20230630
    ''' </summary>
    ''' <param name="container">批次ID或批次名</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsCombinateContainer(ByVal container As String) As Boolean
    ''' <summary>
    ''' 获取父卡的信息（通过子卡的批次ID）add by zhangrj 20230704
    ''' </summary>
    ''' <param name="containerId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetFaContainerInfoBySubContainerID(ByVal containerId As String) As DataTable

    Sub SaveContainerAttr(ByVal containerId As String, ByVal attrName As String, ByVal attrValue As String)

    Sub WriteContainerSCLog(ByVal id As String, ByVal containerid As String, ByVal containername As String, ByVal msg As String, ByVal taskType As Integer, ByVal emp As String)
    ''' <summary>
    ''' 删除批次定时日志
    ''' add:Wangjh 20230908
    ''' </summary> 
    ''' <param name="containerid"></param>
    ''' <param name="taskType">类型</param>
    ''' <remarks></remarks>
    Sub DeleteContainerSCLog(ByVal containerid As String, ByVal taskType As Integer)
    
End Interface
